home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Delphi Magazine Collection 2001
/
Delphi Magazine Collection 20001 (2001).iso
/
DISKS
/
Issue55
/
construc
/
LOGIN.DPR
< prev
next >
Wrap
Text File
|
2000-02-07
|
710b
|
30 lines
program login;
{$APPTYPE CONSOLE}
uses
DrBobCGI, Base64;
begin
if (Authorization = '') then
begin
writeln('HTTP/1.0 401 Unauthorized');
writeln('content-type: text/html');
writeln('WWW-Authenticate: Basic realm="/DrBob"')
end
else
begin
writeln('HTTP/1.0 200 OK');
writeln('content-type: text/html');
writeln;
writeln('<HTML>');
writeln('<BODY>');
writeln('['+Authorization+']');
if Pos('Basic ',Authorization) = 1 then Delete(Authorization,1,6);
writeln('<P>');
writeln('['+Authorization+']');
writeln('<P>');
writeln('['+UnBase64(Authorization)+']');
writeln('</BODY>');
writeln('</HTML>')
end
end.